<template>
	<van-pull-refresh
		v-model="loading"
		@refresh="handleRefresh"
		:success-text="$t('common.refresher.successtext', '刷新成功')"
		:disabled="disabled"
	>
		<slot></slot>
	</van-pull-refresh>
</template>
<script setup lang="ts">
import { refresherProps } from './refresher';
const loading = ref(false);
const props = defineProps(refresherProps);
const handleRefresh = async (event: any) => {
	loading.value = true;
	try {
		await props.refresherCallBack();
		loading.value = false;
	} catch (error) {
		console.log(error);
	}
};
</script>
